{% extends 'base.html' %}

{% block title %}管理后台 - Will's Blog{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-3">
        {% include 'admin/sidebar.html' %}
    </div>
    
    <div class="col-md-9">
        <h1 class="mb-4">管理后台</h1>
        
        <div class="row">
            <div class="col-md-4">
                <div class="card text-center mb-4">
                    <div class="card-body">
                        <h1 class="display-4">{{ posts_count }}</h1>
                        <h5 class="card-title">文章</h5>
                        <a href="{{ url_for('admin.posts') }}" class="btn btn-primary">管理文章</a>
                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
                <div class="card text-center mb-4">
                    <div class="card-body">
                        <h1 class="display-4">{{ comments_count }}</h1>
                        <h5 class="card-title">评论</h5>
                        <a href="{{ url_for('admin.comments') }}" class="btn btn-primary">管理评论</a>
                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
                <div class="card text-center mb-4">
                    <div class="card-body">
                        <h1 class="display-4">{{ tags_count }}</h1>
                        <h5 class="card-title">标签</h5>
                        <a href="{{ url_for('admin.tags') }}" class="btn btn-primary">管理标签</a>
                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
                <div class="card text-center mb-4">
                    <div class="card-body">
                        <h1 class="display-4">{{ uploads_count }}</h1>
                        <h5 class="card-title">文件</h5>
                        <a href="{{ url_for('admin.uploads') }}" class="btn btn-primary">管理文件</a>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h5 class="mb-0">快速操作</h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <a href="{{ url_for('admin.new_post') }}" class="btn btn-success mb-2 w-100">
                            <i class="bi bi-file-earmark-plus"></i> 新建文章
                        </a>
                    </div>
                    <div class="col-md-6">
                        <a href="{{ url_for('admin.new_tag') }}" class="btn btn-info mb-2 w-100">
                            <i class="bi bi-tag"></i> 新建标签
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}